{% extends 'base_main.html' %}
{% load static %}
{% block extcss %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'app/market/market.css' %}">
{% endblock %}
{% block extjs %}
    <script type="text/javascript" src="{% static 'app/market/market.js' %}"></script>
{% endblock %}
{% block content %}
    <div id="market">
        <aside>
            <ul>
                {% for type in goodstypes %}
                    <li><a href="{% url 'axf:marketParams' type.typeid '0' '0' %}">{{ type.typename }}</a>
                        {#                    点击该分类时，该分类有一个黄色的提示#}
                        {% ifequal type.typeid typeid %}
                            <span class="yellowSlide"></span>
                        {% endifequal %}
                    </li>
                {% endfor %}
            </ul>
        </aside>
        <section>
            <nav>
                <ul>
                    <li id="all_types"><span>全部分类<span class="glyphicon glyphicon-chevron-down"
                                                       id="all_type_logo"></span></span></li>
                    <li id="all_sorts"><span>综合排序<span class="glyphicon glyphicon-chevron-down"
                                                       id="all_sorts_logo"></span></span></li>
                </ul>
            </nav>
            <menu>
                <ul>
                    {% for goods in goods_list %}

                        <li>
                            <a href="#">
                                <img src="{{ goods.productimg }}" alt="{{ goods.productlongname }}">
                                <div class="shoppingInfo">
                                    <h6>{{ goods.productlongname }}</h6>
                                    <p class="detailTag">
                                        <span>精选</span>
                                        <span></span>
                                    </p>
                                    <p class="unit">
                                        {{ goods.specifics }}
                                    </p>
                                    <p class="price">
                                        <span>¥{{ goods.price }}</span>
                                        <s>¥{{ goods.marketprice }}</s>
                                    </p>
                                </div>
                            </a>
                            <section>
                                <button class="subShopping" goodsid="{{ goods.id }}">-</button>
                                <span>0</span>
                                <button class="addShopping" goodsid="{{ goods.id }}">+</button>
                            </section>
                        </li>

                    {% endfor %}
                </ul>
                <div id="all_types_container">
                    <div>
                        {% for child_type in child_type_list %}
                            {#                    获取到大类中的每个子类名字#}
                            <a href="{% url 'axf:marketParams' typeid child_type.1 0 %}"><span>{{ child_type.0 }}</span></a>
                        {% endfor %}
                    </div>
                </div>
                <div id="sorts_container">
                    <div>
                        {#      排序传递的也是状态码   0 , 1 ,2  , 3 ,4 ,5...                    #}
                        <a href="{% url 'axf:marketParams' typeid cid 0 %}">
                            <span>综合排序</span>
                        </a>
                        <a href="{% url 'axf:marketParams' typeid cid 1 %}">
                            <span>销量排序</span>
                        </a>
                        <a href="{% url 'axf:marketParams' typeid cid 2 %}">
                            <span>价格降序</span>
                        </a>
                        <a href="{% url 'axf:marketParams' typeid cid 3 %}">
                            <span>价格升序</span>
                        </a>
                    </div>
                </div>
            </menu>
        </section>
    </div>
{% endblock %}